<template>
  <div>
  <el-card class="box-card">
    <div slot="header" class="clearfix">
      <span style="font-weight: bold;font-size: 20px">最近更新</span>
      <!--<el-button style="float: right; padding: 3px 0" type="text">修改</el-button>-->
    </div>
    <div class="block">
      <el-timeline>
        <el-timeline-item  placement="top"v-for="(item,i) in list" :key="i">
          <el-card>
            <h4>{{item.commont}}</h4>
            <p>{{item.title}} 提交于 {{item.addtime}}</p>
          </el-card>
        </el-timeline-item>
      </el-timeline>
    </div>
  </el-card>

    <div style="display: flex;justify-content: center;margin-top: 10px">
      <el-pagination
              background
              @size-change="sizeChange"
              @current-change="currentChange"
              :current-page="currentPage"
              :page-size="pageSize"
              layout="sizes, prev, pager, next, jumper, ->, total, slot"
              :total="total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
  import Page from "../common/page";
  import {findLog} from "../../api/system/user";
  export default {
    name: 'UpdateCard',
    components: {Page},
    data(){
      return{
        list:'',
        pageSize:'5',
        currentPage:'1',
        total:0
      }
    },
    created() {
      this.init()
    },
    methods:{
      init(){
        findLog().then(resp=>{
          //console.log(resp.data.pageinfo)
          this.list=resp.data.pageinfo.list
          this.total=resp.pageinfo.total
        })
      },
      initUser() {
        cfindLog(this.currentPage,this.pageSize).then(resp => {
          if (resp) {
            this.list=resp.pageInfo.list
            this.total=resp.pageinfo.total
          }
        })
      },
      sizeChange(size) {
        this.pageSize=size;
        this.initUser();
      },
      currentChange(page) {
        this.currentPage=page;
        this.initUser();
      }
    }
    /*created() {
      findLog()
      var _this=this
      /!*this.$axios.post('system/user/profile/findLog').then(resp=>{

        console.log(resp.data)
        this.list=resp.data.result.data
        this.total=resp.data.result.total
      })*!/
    }*/
  }
</script>

<style scoped>
  .box-card {
    margin-top: 5px;
    width: 988px;
    height: 1050px;
    text-align: left;
  }
</style>
